package Bots;


import cz.cuni.amis.pogamut.base.utils.guice.AgentScoped;
import cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot;
import cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotModuleController;

@AgentScoped
public class Buffer extends UT2004BotModuleController<UT2004Bot> {
    /////////////////////////////////////////////////	
    public int numState;
    public int numAction;

    public double[] stat;
    public int action;
    public double r;
    public double[] next_stat;

    public double p;
    public double w;
    public boolean end;


    public Buffer(int numState, int numAction) {
        this.numState = numState;
        this.numAction = numAction;

        stat = new double[numState];
        next_stat = new double[numState];
        action = 0;
        r = 0;
        p = 1;
        w = 1;
        end = false;
    }

    public void Replay_Buffer(double[] stat, int action, double r, double[] next_stat, boolean end) {
        if (this.numState >= 0) System.arraycopy(stat, 0, this.stat, 0, this.numState);
        this.action = action;
        this.r = r;
        if (this.numState >= 0) System.arraycopy(next_stat, 0, this.next_stat, 0, this.numState);
        this.end = end;

        this.p = 1;
        this.w = 1;
    }


}
